package soft.test;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import soft.mapper.AdminMapper;
import soft.service.AdminService;
import soft.service.impl.AdminServiceImpl;

import java.io.IOException;

public class test {

    @Test
    public void t01() throws IOException{
        ApplicationContext ctx = new ClassPathXmlApplicationContext("application-context.xml");
        AdminService adminService = ctx.getBean("adminService",AdminService.class);
        adminService.getById("2017030");
    }
//    @Test
//    public void T4() throws IOException
//    { //读配置文件
//        ApplicationContext ctx = new ClassPathXmlApplicationContext("application-context.xml");
//        AdminService adminService = ctx.getBean("adminService",AdminService.class);
//        System.out.println(adminService.login("1","1"));
//
//    }

    @Test
    public void t03() throws IOException{
        ApplicationContext ctx = new ClassPathXmlApplicationContext("application-context.xml");
        AdminMapper adminMapper = ctx.getBean("adminMapper",AdminMapper.class);
        adminMapper.getById("2017030");
    }

    @Test
    public void t04() throws IOException{
        ApplicationContext ctx = new ClassPathXmlApplicationContext("application-context.xml");
        AdminMapper adminMapper = ctx.getBean("adminMapper",AdminMapper.class);
        adminMapper.login("2017030","123456");
    }
}
